package cn.yutong.system.service.impl;

import cn.yutong.system.entity.User;
import cn.yutong.system.mapper.UserMapper;
import cn.yutong.system.service.IUserService;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统用户表 服务实现类
 * </p>
 *
 * @author lnexin
 * @since 2018-11-26
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public List<User> selectAll() {
        return baseMapper.selectAll();
    }

    @Override
    public User selectUsername(String username) {
        User user = new User();
        user.setUsername(username);
        return baseMapper.selectOne(user);
    }

    @Override
    public Page<User> queryUserByPage(Page<User> page) {
        return page.setRecords(baseMapper.queryUserList(page));
    }
}
